[mirrors]
http://nodejs.org/dist/v0.12.9/node-v0.12.9.tar.gz

[vars]
filesize=19582666
sha512=8b46864a1a2796fb45331dba21968676f491c3cfff2af31ec61a97dc78f2fa2f4143b1365d7218dbc471ea68407a55c65b9c7bbd0a73130284b38091639eedd2


[deps.host]
dynamic-toolchain
python

[build]
# nodejs has 3 supported versions currently:
# - v5 (stable)
# - v4 (LTS)
# - v0.12 (Maintenance, does not require GCC 4.8, support end: 2017)

patch -p1 < "$K"/nodejs-nameser_compat.h
patch -p1 < "$K"/nodejs-openssl_termios.h
patch -p1 < "$K"/nodejs-prefix.patch

CFLAGS="-D_GNU_SOURCE $optcflags" CXXFLAGS="-D_GNU_SOURCE $optcflags" LDFLAGS="$optldflags" ./configure --prefix="$butch_prefix"

# the python configure script does not care about C(XX)FLAGS being passed
sed -i "s@cflags': \[\]@cflags': ['-D_GNU_SOURCE -D_BSD_SOURCE']@" config.gypi

make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install
